package com.boot.unity.api.wx.controller;

import com.boot.unity.api.wx.service.WxLearnTimeSettingService;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 学时服务
 */
@RestController
@RequestMapping("/wx/learntime")
@Validated
public class WxLearnTimeController {
    private final Log logger = LogFactory.getLog(WxLearnTimeController.class);


    @Autowired
    private WxLearnTimeSettingService wxLearnTimeSettingService;

    /**
     * 查询当前用户的学时
     * @user hys
     */
    @GetMapping("getXsDetail")
    public Object getXsDetail(String uid,String key){
       return wxLearnTimeSettingService.getXsDetail(uid,key);
    }
    /**
     * 查询标准学时
     * **/
    @GetMapping("queryHour")
    public Object queryHour(String uid,String key){
        return wxLearnTimeSettingService.queryHour(uid,key);
    }

    /**
     * 预约培训
     * 查询当前用户是否可进行预约
     * @return
     */
    @PostMapping("mySchoolInfo")
    @GetMapping("mySchoolInfo")
    public Object mySchoolInfo(String uid,String key) {
        return wxLearnTimeSettingService.mySchoolInfo(uid,key);
    }

}
